/*
Copyright 2007 mudlord. All rights reserved. 

Redistribution and use in source and binary forms, 
with or without modification, are permitted provided that 
the following conditions are met: 

 1. Redistributions of source code must retain the above copyright notice, 
    this list of conditions and the following disclaimer. 

 2. Redistributions in binary form must reproduce the above copyright notice, 
    this list of conditions and the following disclaimer in the documentation 
    and/or other materials provided with the distribution. 

THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 
THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
*/
/**************************
 * Includes for this app
 *
 **************************/
#include "mudregkeyremover.h"
/**************************
 * Function Declarations
 *
 **************************/
LRESULT CALLBACK WndProc (HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam);
BOOL APIENTRY MainDlgProc (HWND hDlg, UINT message, UINT wParam, LONG lParam); 
/**************************
 * Sets up Dialogs
 * 
 *
 **************************/

int WINAPI WinMain (HINSTANCE hInstance,
                    HINSTANCE hPrevInstance,
                    LPSTR lpCmdLine,
                    int iCmdShow)
{
    DialogBox (hInstance, MAKEINTRESOURCE(IDD_DLG1 ), 0, MainDlgProc); 
}

/********************
 * Window Procedure
 ********************/

LRESULT CALLBACK WndProc (HWND hWnd, UINT message,
                          WPARAM wParam, LPARAM lParam)
{

    switch (message)
    {
    case WM_CREATE:
        return 0;
    case WM_CLOSE:
        PostQuitMessage (0);
        return 0;
    case WM_DESTROY:
        return 0;


    default:
        return DefWindowProc (hWnd, message, wParam, lParam);
    }
}



BOOL APIENTRY MainDlgProc (HWND hDlg, UINT message, UINT wParam, LONG lParam) 
        { 
    switch (message) 
        { 
                // Initialize the dialog box 
  case WM_INITDIALOG: 

  {
   MessageBox(0,"Please note that you need to have the appropriate usage rights to run this effectively.\nAlso, be CAREFUL! Changes cannot be undone...\n\nClick OK to continue","A warning..", MB_OK | MB_TASKMODAL);
  }
  break; 


 // Process command messages 
 case WM_COMMAND: 
				switch(LOWORD(wParam))
                        { 
                        // Validate and Make the changes 
                       
		     	case IDC_STABLE:
					RegDeleteKey(HKEY_CURRENT_USER,"Software\\Mudlord\\Rice's Video Plugin\\Stable");
                        break;
				case IDC_DEVEL:
					RegDeleteKey(HKEY_CURRENT_USER,"Software\\Mudlord\\Rice's Video Plugin\\Development");
                        break;
				case IDC_ALPHA:
					RegDeleteKey(HKEY_CURRENT_USER,"Software\\Mudlord\\Rice's Video Plugin\\Alpha");
                        break;
				case IDC_JABIN:
					RegDeleteKey(HKEY_CURRENT_USER,"Software\\JaboSoft\\Project64 DLL\\DirectInput7 1.6\\Keys 0");
					RegDeleteKey(HKEY_CURRENT_USER,"Software\\JaboSoft\\Project64 DLL\\DirectInput7 1.6\\Keys 1");
					RegDeleteKey(HKEY_CURRENT_USER,"Software\\JaboSoft\\Project64 DLL\\DirectInput7 1.6\\Keys 2");
					RegDeleteKey(HKEY_CURRENT_USER,"Software\\JaboSoft\\Project64 DLL\\DirectInput7 1.6\\Keys 3");
					RegDeleteKey(HKEY_CURRENT_USER,"Software\\JaboSoft\\Project64 DLL\\DirectInput7 1.6");
                        break;
				case IDC_JABAUD:
					RegDeleteKey(HKEY_CURRENT_USER,"Software\\JaboSoft\\Project64 DLL\\DirectSound 1.6");
                        break;
				case IDC_JABVID:
					RegDeleteKey(HKEY_CURRENT_USER,"Software\\JaboSoft\\Project64 DLL\\Direct3D8 1.6");
					RegDeleteKey(HKEY_CURRENT_USER,"Software\\JaboSoft\\Project64 DLL\\Direct3D6 1.5.2");
                        break;
				case IDC_JABRSP:
					RegDeleteKey(HKEY_CURRENT_USER,"Software\\N64 Emulation\\DLL\\RSP 1.6");
                        break;
				case IDC_DIRECT64:
					RegDeleteKey(HKEY_CURRENT_USER,"Software\\N64 Emulation\\DLL\\Direct64");
                        break;
				case IDC_GLN64:
					RegDeleteKey(HKEY_CURRENT_USER,"Software\\N64 Emulation\\DLL\\glN64");
                        break;
				case IDC_ZILMAR:
					RegDeleteKey(HKEY_CURRENT_USER,"Software\\N64 Emulation\\DLL\\ZilAudio");
                        break;
				case IDC_WRAPPER:
					RegDeleteKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\GlideWrapper");
                        break;
				case IDC_RV543:
					RegDeleteKey(HKEY_CURRENT_USER,"SOFTWARE\\RICEVIDEO543\\WINDOW");
                        break;
				case IDC_RV55:
					RegDeleteKey(HKEY_CURRENT_USER,"SOFTWARE\\RICEVIDEO550\\WINDOW");
                        break;
				case IDC_RV61:
					RegDeleteKey(HKEY_CURRENT_USER,"SOFTWARE\\RICEVIDEO\\Version610");
					RegDeleteKey(HKEY_CURRENT_USER,"SOFTWARE\\RICEVIDEO");
                        break;

				}break;
                // Closed from sysbox 
                case WM_CLOSE: 
                EndDialog(hDlg,TRUE); 
                break; 
                } 

        return FALSE; 
} 





